package br.com.primeira.scenes.gamescenes;

import org.andengine.entity.scene.background.Background;
import org.andengine.entity.scene.menu.MenuScene;
import org.andengine.entity.scene.menu.MenuScene.IOnMenuItemClickListener;
import org.andengine.entity.scene.menu.item.IMenuItem;
import org.andengine.entity.scene.menu.item.SpriteMenuItem;

import android.opengl.GLES20;
import br.com.primeira.activities.GameActivity;
import br.com.primeira.scenes.GameMenuScene;

public class MainMenuScene extends GameMenuScene implements IOnMenuItemClickListener
{
	public MainMenuScene(GameActivity gameActivity)
	{
		super(gameActivity, gameActivity.getEngine().getCamera());
		
		setBackground(new Background(0.09804f, 0.6274f, 0.8784f));
		
		final SpriteMenuItem resetMenuItem = new SpriteMenuItem(0, assetPool.getTextureRegion("splash"), gameActivity.getEngine().getVertexBufferObjectManager());
		resetMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
		addMenuItem(resetMenuItem);

		final SpriteMenuItem quitMenuItem = new SpriteMenuItem(1, assetPool.getTextureRegion("splash"), gameActivity.getEngine().getVertexBufferObjectManager());
		quitMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
		addMenuItem(quitMenuItem);

		buildAnimations();

		setBackgroundEnabled(false);
	}

	@Override
	public boolean onMenuItemClicked(MenuScene pMenuScene, IMenuItem pMenuItem, float pMenuItemLocalX, float pMenuItemLocalY)
	{
		switch(pMenuItem.getID())
		{
			case 0:
				System.out.println("PRIMEIRO BOTAO");
				return true;
				
			case 1:
				System.out.println("SEGUNDO BOTAO");
				return true;
				
			default:
				return false;
		}
	}
}
